package weapon

import (
	"fmt"
	"ys.calc/pointFunction"
	"ys.calc/role"
)

func InitDeathMatch(refineLevel float64, times float64) Weapon {
	var subStatValue = 36.8
	var mainStateValue = 454.0
	return Weapon{
		Name:     fmt.Sprintf("精%d决斗枪%d层", int(refineLevel), int(times)),
		Atk:      mainStateValue,
		Code:     3,
		SubState: subStatValue,
		SubStateFunc: func(r *role.Role) {
			pointFunction.AddCritRate(subStatValue, r)
		},
		SpFunc: func(r *role.Role) {
			DeathMatchSp(refineLevel, times, r)
		},
	}
}
func DeathMatchSp(refineLevel float64, times float64, r *role.Role) {
	bonus := 0.16
	if times < 2 {
		bonus = 0.24
	}
	r.AtkEx += r.Atk * bonus * (1 + (refineLevel-1)*0.25)
}
